#ifndef BUILDER_H_
#define BUILDER_H_

#include "animal.h"

class AnimalBuilder
{
public:
	virtual void buildName() {}
	virtual void buildWing() {}
	virtual void buildFoot() {}
	virtual void buildTail() {}

	virtual Animal* getAnimal() { return NULL; }
};

class CatBuilder : public AnimalBuilder
{
public:
	CatBuilder()
	{
		m_pAnimal = new Animal();
	}

public:
	void buildName()
	{
		m_pAnimal->name = "Cat";
	}

	void buildFoot()
	{
		m_pAnimal->countFoot = 4;
	}

	void buildTail()
	{
		m_pAnimal->countTail = 1;
	}

	Animal* getAnimal()
	{
		return m_pAnimal;
	}

private:
	Animal* m_pAnimal;
};

class ChickenBuilder : public AnimalBuilder
{
public:
	ChickenBuilder()
	{
		m_pAnimal = new Animal();
	}

public:
	void buildName()
	{
		m_pAnimal->name = "Chicken";
	}
	void buildWing()
	{
		m_pAnimal->countWing = 2;
	}

	void buildFoot()
	{
		m_pAnimal->countFoot = 2;
	}

	void buildTail()
	{
		m_pAnimal->countTail = 1;
	}

	Animal* getAnimal()
	{
		return m_pAnimal;
	}

private:
	Animal* m_pAnimal;
};

#endif // BUILDER_H_
